import store from "@/store";

function isLogin() {
  return store.getters["user/isLogin"];
}
export function createRouterGuide(router) {
  router.beforeEach((to, from, next) => {
    to.meta.referer = from.fullPath;
    if (to.meta?.isPublic || isLogin()) {
      return next();
    }
    return false;
  });
}
